package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.KpiDevOperatingRateDao;
import com.sugon.entity.KpiDevOperatingRateEntity;
import com.sugon.service.KpiDevOperatingRateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * KPI报表展示中用到的设备开动率数据Service实现类
 *
 * @author sugon
 * @date 2020-07-18 19:43:53
 */
@Service("kpiDevOperatingRateService")
public class KpiDevOperatingRateServiceImpl implements KpiDevOperatingRateService {
    @Autowired
    private KpiDevOperatingRateDao kpiDevOperatingRateDao;

    @Override
    public KpiDevOperatingRateEntity queryObject(String id) {
        return kpiDevOperatingRateDao.queryObject(id);
    }

    @Override
    public List<KpiDevOperatingRateEntity> queryList(Map<String, Object> map) {
        return kpiDevOperatingRateDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return kpiDevOperatingRateDao.queryTotal(map);
    }

    @Override
    public int save(KpiDevOperatingRateEntity kpiDevOperatingRate) {
        kpiDevOperatingRate.setId(RandomUtil.randomString(32));
        return kpiDevOperatingRateDao.save(kpiDevOperatingRate);
    }

    @Override
    public int update(KpiDevOperatingRateEntity kpiDevOperatingRate) {
        return kpiDevOperatingRateDao.update(kpiDevOperatingRate);
    }

    @Override
    public int delete(String id) {
        return kpiDevOperatingRateDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return kpiDevOperatingRateDao.deleteBatch(ids);
    }
}
